package cn.mdmm.user;

import java.io.File;
import java.io.IOException;

import org.junit.Test;

import cn.mdmm.base.InterfaceBaseTest;
import cn.mdmm.base.PostClient;
import cn.mdmm.base.URLCOMMON;

public class loginTest extends InterfaceBaseTest {

	@Override
	public String getUrl() {
		return URLCOMMON.ONLINETEST_URL;
	}
	
	@Test
	public void checkUser() {
		paramMap.put("method", "user.check");
		paramMap.put("phone", "15871383472");
	}

	@Test
	public void sendCode(){
		paramMap.put("method", "user.sendCode");
		paramMap.put("phone", "15871383472");
	}
	
	@Test
	public void register() {
		paramMap.put("method", "user.register");
		paramMap.put("phone", "15871383472");
		paramMap.put("code", "5787");
		paramMap.put("userPwd", "123456");
		paramMap.put("roleIds", "4");
	}

	@Test
	public void login() {
		paramMap.put("method", "user.login");
		paramMap.put("phone", "15871383472");
		paramMap.put("userPwd", "123456");
	}
	
	@Test
	public void updatePwd() {
		paramMap.put("method", "user.updatePwd");
		paramMap.put("sessionKey", "6c41f82c39de89425cfcf4bdd96fef91");
		paramMap.put("newPwd", "123456");
		paramMap.put("confirmPwd", "123456");
	}
	
	@Test
	public void updateUser() {
		paramMap.put("method", "user.updateUser");
		paramMap.put("sessionKey", "6c41f82c39de89425cfcf4bdd96fef91");
		paramMap.put("realName", "测试1234");
		paramMap.put("sex", "0");
		fileMap.put("headImgUrl", new File("F:/file/img/1.jpg"));
	}
	
	@Test
	public void resetPwd() {
		paramMap.put("method", "user.resetPwd");
		paramMap.put("phone", "15871383477");
		paramMap.put("code", "5681");
		paramMap.put("newPwd", "111111");
		paramMap.put("confirmPwd", "111111");
	}
	
	public static void main(String[] args) throws IOException {
		 String data = PostClient.doPost("http://localhost/test", null);
        System.out.println("---出参：" + data);
	}
}